﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    brand.cyt369.com.models.Category category = ViewBag.category as brand.cyt369.com.models.Category;
    int categoryID = ViewBag.categoryID;
    int? amount = ViewBag.amount;
    int? cityID = ViewBag.cityID;
    List<brand.cyt369.com.models.Base.City> citys = ViewBag.citys as List<brand.cyt369.com.models.Base.City>;
}
<input type="hidden" id="parentCategoryID" value="@(category==null?0:@category.Id)" />
<input type="hidden" id="initCategoryID" value="@categoryID"/>
<input type="hidden" id="initAmount" value="@amount"/>
<input type="hidden" id="initCityID" value="@cityID" />
<!-- 餐饮分类 -->

<div class="category-one" id="category-div">
    <p class="p1">@(category==null?"餐饮":category.CategoryName)分类</p>
    <p class="p2">
        <a href="javascript:void(0);" class="active" onclick="categoryChange(0)">
            <span class='@(categoryID==0||category==null?"selected":"")'>不限</span>
        </a>
    </p>
    <p class="p3">
        @if (category != null)
        {
            @if(category.Childs!=null)
            @foreach (var child in category.Childs)
            {
                <a href="javascript:void(0);" category="@child.Id" onclick="categoryChange(@child.Id)">
                    <span class='@(categoryID==child.Id?"selected":"")'>@child.CategoryName</span>
                </a>
                }
        }
        else
        {
            @* 搜索情况下，显示一级类别 *@
            IQueryable<brand.cyt369.com.models.Category> allParentCategorys = ViewBag.allParentCategorys as IQueryable<brand.cyt369.com.models.Category>;
            if (allParentCategorys != null)
            {
                @foreach (var c in allParentCategorys)
                {
                    <a href="javascript:void(0);" category="@c.Id" onclick="parentCategoryChange(@c.Id)">
                        <span>@c.CategoryName</span>
                    </a>
                }
            }
        }
     </p>
</div>

<!-- 投资金额 -->
<div class="category-one" id="amount-div">
    <p class="p1">投资金额</p>
    <p class="p2">
        <a href="javascript:void(0);" class="active" onclick="amountChange(0)">
            <span class='@(amount==0||amount==null?"selected":"")'>不限</span>
        </a>
    </p>
    <p class="p3" >
        <a href="javascript:void(0);" onclick="amountChange(1)"><span class='@(amount==1?"selected":"")'>5万以下</span></a>
        <a href="javascript:void(0);" onclick="amountChange(2)"><span class='@(amount==2?"selected":"")'>5-10万</span></a>
        <a href="javascript:void(0);" onclick="amountChange(3)"><span class='@(amount==3?"selected":"")'>10-20万</span></a>
        <a href="javascript:void(0);" onclick="amountChange(4)"><span class='@(amount==4?"selected":"")'>20-50万</span></a>
        <a href="javascript:void(0);" onclick="amountChange(5)"><span class='@(amount==5?"selected":"")'>50-100万</span></a>
        <a href="javascript:void(0);" onclick="amountChange(6)"><span class='@(amount==6?"selected":"")'>100万以上</span></a>
    </p>
</div>

<!-- 加盟区域 -->
<div id="citybox-div" class="category-one">
    <p class="p1">加盟区域</p>
    <p class="p2"><a href="javascript:cityChange(0)" class="active"><span id="span-city-0" class='@(cityID==0||cityID==null?"selected":"")'>不限</span></a></p>
    <p class="p3">
        @if (citys!=null)
        {
            @foreach(var c in citys)
            {
                <a href="javascript:cityChange(@c.Id)"><span id="span-city-@c.Id" class='@(c.Id==cityID?"selected":"")'>@c.CityName</span></a>
            }
        }
    </p>
</div>